export const Platform = {
  MINI_PROGRAM: '小程序',
  WECHAT_H5: '微信 h5',
};

export function checkIsWx() {
  if (window.__wxjs_environment === 'miniprogram') {
    return Platform.MINI_PROGRAM;
  }

  let ua = window.navigator.userAgent.toLowerCase();
  if (/MicroMessenger/i.test(ua)) {
    return Platform.WECHAT_H5;
  }
  return undefined;
}
